package com.guchenbo.study.aop;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/")
public class IndexController {

    @Resource
    private TxServiceA txServiceA;
    @Resource
    private UserService userService;

    @GetMapping("/1")
    public String t1() {
        txServiceA.defaultTx(true,true);
        return "ok";
    }
    @GetMapping("/2")
    public String t2() {        txServiceA.defaultTx(true,false);

        return "ok";
    } @GetMapping("/3")
    public String t3() {        txServiceA.defaultTx(false,false);

        return "ok";
    } @GetMapping("/4")
    public String t4() {        txServiceA.defaultTx(false,true);

        return "ok";
    }
}
